package series;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Season implements Comparable<Season>{
	
	private int id;
	private String name;
	private int number;
	private int seriesId;
	private List<Episode> episodes = new ArrayList<Episode>();

	public Season() {
		super();
	}
	
	public Season(int id, int seriesId, String name, int number) {
		super();
		this.id = id;
		this.name = name;
		this.number = number;
		this.seriesId = seriesId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public List<Episode> getEpisodes() {
		return episodes;
	}

	public void setEpisodes(List<Episode> episodes) {
		this.episodes = episodes;
	}
	
	public int getSeriesId() {
		return seriesId;
	}
	
	public void setSeriesId(int seriesId) {
		this.seriesId = seriesId;
	}
	
	@Override
	public int compareTo(Season o) {
		return Integer.valueOf(number).compareTo(Integer.valueOf(o.number));
	}
	
	public void addEpisode(Episode e) {
		episodes.add(e);
	}

	
}
